package question2;

import question1.HTTPSensor;
import question1.CyclicAcquisition;

/**
 * Classe principale d'execution de la question 2 du TP.
 * Genere une chaine de responsablilite.
 * 
 * @author Jacquemin Thibault
 * @author Marleix Mathieu
 */
public class Main
{

	public static void main( String[] args ) throws Exception
	{
		HTTPSensor.setHttpProxy( "cache.esiee.fr", 3128 );
		HTTPSensor ds2438= null;
		if ( args.length == 0 )
			ds2438= new HTTPSensor();
		else
			ds2438= new HTTPSensor( args[0] );

		//a completer
		Handler<Float> chain= new FileHandler("mesures",new TraceHandler(new MinHandler(new MaxHandler(null))));

		CyclicAcquisition acquisition= new CyclicAcquisition( ds2438, 1000,
				new ChainCommand<Float>( chain ) );
		acquisition.start();

		Thread.sleep( 1000 * 10 );

		acquisition.stop();
	} // main()
} // Main
